<div id="media">
    <div id="media_border">
        <img src="<?php echo Utility::getSiteUrl();?>/public/images/media.png"/>
    </div>
    <div id="media_img">
        <?php
            if(isset($album_items) && $album_items->getSize() > 0)
        {
        $item = $album_items->getRow(0);
        ?>
        <img id="media_image" src="<?php echo Utility::getSiteUrl() . '/public/images/' . $item->image;?>"
        />
        <?php
            }
        ?>
    </div>
</div>
<div id="content">
    <div id="head_content">
        <div id="left_head_content">
            <a class="prevPage  left"></a>
            <div class="scrollable">
                <div class="items">
                    <?php
                    if(isset($album_items))
                    {
                        $size = $album_items->getSize();
                        for($i = 0;$i < $size; $i++)
                        {
                        	$item = $album_items->getRow($i);
                        ?>
	                        <img src="<?php echo Utility::getSiteUrl() . '/public/images/' . $item->image;?>" onmouseover="showImage(this.src)"; />
                        <?php
                            }
                        }
                    ?>
                </div>
            </div>
            <a class="nextPage right"></a>
        </div>
        <script>
            $(function()
            {
                $("div.scrollable").scrollable({size: 4});
            });
        </script>
        <div id="right_head_content">
            <h4><?php echo $category->name;?></h4>
        </div>
        <div class="vide"></div>
    </div>
    <div id="body_content">
        <?php
        if(isset($news_list) && $news_list->getSize() > 0)
        {
            $size = $news_list->getSize();
        for($i = 0 ; $i < $size; $i++)
        {
        $news = $news_list->getRow($i);
        ?>
        <div class='category_detail'>
            <div class='title_news'>
                <a href="<?php echo Utility::getSiteUrl() . '/news/show/' . $news->id;?>"> <?php echo $news->title; ?></a>
            </div>
            <div class='content_img'>
                <img src="<?php echo (strlen($news->avatar) != 0?$news->avatar:Utility::getSiteUrl() . '/public/images/default.png'); ?>" alt='nothing is impossible'/>
            </div>                       
                <div class='summary_news'>
                    <span><?php echo $news->summary; ?></span>
                </div>            
            <div class='time'><?php echo $news->p_date; ?></div>
            <div class="vide"></div>
        </div>
        <?php
            }
        }
        else //no news available
        {
            ?>
        <div class='category_detail'>
            
                <div class='title_news'>Trang này chưa có bài viết</div>
            
            <div class="vide"></div>
        </div>
            <?php
        }
        ?>


    </div>
    <div id="foot_content">
        <?php if($page > 1){ ?>
        <div id="previous">
            <a href="<?php echo Utility::getSiteUrl();?>/category/show/<?php echo $cat_id . '/' . ($page - 1);?>">Previous</a>
        </div>
        <?php } ?>
        <div id="next">
            <a href="<?php echo Utility::getSiteUrl();?>/category/show/<?php echo $cat_id . '/' . ($page + 1);?>">Next</a>
        </div>
    </div>
</div>
</div>